package top.aprillie.mamabike.bike.dao;

import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Component;
import top.aprillie.mamabike.bike.entity.Bike;
import top.aprillie.mamabike.bike.entity.BikeNoGen;

@Mapper
@Component(value = "bikeMapper")
public interface BikeMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Bike record);

    int insertSelective(Bike record);

    Bike selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(Bike record);

    int updateByPrimaryKey(Bike record);

    /**
     * 按序生成单车编号并创建单车
     *
     * @param bikeNoGen
     */
    void generateBikeNo(BikeNoGen bikeNoGen);

    /**
     * 根据单车编号查询单车信息
     *
     * @param bikeNo
     * @return
     */
    Bike selectByBikeNo(Long bikeNo);
}